package com.xiyue.server.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sport.model.entity.SysRole;
import com.sport.model.vo.RoleAuthVo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 角色表;(sys_role)表数据库访问层
 * @author: xiyue
 * @date : 2025-8-10
 */
@Mapper
public interface SysRoleMapper extends BaseMapper<SysRole> {

    @Select("SELECT permission_id FROM `sys_role_permission` WHERE role_id = #{roleId}")
    List<String> getPermissions(@Param("roleId") String roleId);

    Boolean insertCheck(RoleAuthVo roleAuthVo);

    Boolean deleteCheck(RoleAuthVo roleAuthVo);
}